<%@ page import="java.util.Date" %>
<%@ page import="myschool.entity.Student" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setAttribute("Age",79);
    String p[]={"西红柿","桃子","杏子","苹果"};
    request.setAttribute("msg",new Date());
    request.setAttribute("fruit",p);
    Student stu=new Student();
    stu.setAddress("阜阳");
    stu.setQQ("1o9333");
    stu.setSname("南霸天");
    request.setAttribute("student",stu);

    pageContext.setAttribute("tip","tip in page");
    request.setAttribute("tip","tip in requsest");
    session.setAttribute("tip","tip in session");
    application.setAttribute("tip","tip in application");
%>
<h2>
    ${Age},<c:out value="${Age}"/>
</h2>
<h2>
    <c:if test="${Age>=18}">
        成年人
    </c:if>
    <c:if test="${Age<18}">
        成年人
    </c:if>
</h2>
<div style="color:red;font-size:40px">
    <c:choose>
        <c:when test="${Age>=60}">
            老年人
        </c:when>
        <c:when test="${Age>=45}">
            中年人
        </c:when>
        <c:when test="${Age>=18}">
            青年
        </c:when>
        <c:otherwise>未成年</c:otherwise>
    </c:choose>
</div>
<ul type="none">
    <c:forEach items="${fruit}" var="sg" varStatus="s">
    <li>${s.count}:::${sg}</li>
    </c:forEach>
</ul>
<h1>今天日期：<fmt:formatDate value="${msg}" pattern="yyyy/MM/dd HH时mm分ss秒"/></h1>
</body>
</html>
